package com.gamificationlibrary.gamificationlibrary.levels;

import java.util.ArrayList;

import com.gamificationlibrary.gamificationlibrary.model.Score;

public class LevelSystem {

	private ArrayList<Level> levels;
	
	public LevelSystem()
	{
		levels=new ArrayList<Level>();
	}
	
	public void addLevel(Level l)
	{
		levels.add(l);
	}
	
	public Level getLevelWithStatus(Status status)
	{
		for(int i=0;i<levels.size();i++)
		{
			if(levels.get(i).getStatus()==status)
			{
				return levels.get(i);
			}
		}
		return null;
	}
	
	
	public Level getLevelforScore(Score score)
	{
		for(int i=0;i<levels.size();i++)
		{
		if(levels.get(i).checkLevelforScore(score))
		{
			return levels.get(i);
		}
	    }
		return null;
	}
}
